﻿namespace SimpleWebServices.Data
{
    using System;
    using System.Data;

    public static class DataSetExtensionMethods
    {
        public static bool IsEmpty(this DataSet data)
        {
            if (null == data)
            {
                throw new ArgumentNullException("data");
            }

            bool result = true;

            foreach (DataTable table in data.Tables)
            {
                if (0 != table.Rows.Count)
                {
                    result = false;
                    break;
                }
            }

            return result;
        }
    }
}